package com.xiyoufang.club.repository;

import com.xiyoufang.club.entity.ClubOperatorRecord;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public abstract interface ClubOperatorRecordRepository
  extends JpaRepository<ClubOperatorRecord, Integer>
{
  @Query(nativeQuery=true, value="SELECT * FROM club_operator_record t WHERE t.club_id=:clubId AND  t.operator_user_id=:userId AND  t.record_type=:recordType ORDER BY create_time DESC")
  public abstract List<ClubOperatorRecord> findClubOperatorRecordByClubIdAndUserId(@Param("recordType") int paramInt1, @Param("clubId") int paramInt2, @Param("userId") int paramInt3);
  
  @Query(nativeQuery=true, value="SELECT * FROM club_operator_record t WHERE t.club_id=:clubId AND    t.record_type=:recordType ORDER BY create_time DESC")
  public abstract List<ClubOperatorRecord> findClubOperatorRecordByClubId(@Param("recordType") int paramInt1, @Param("clubId") int paramInt2);
}
